e63588
@@ -1109,9 +1109,10 @@
public static void renameOrMoveFiles(FileSystem fs, Path src, Path dst) throws I
   /**
    * The first group will contain the task id. The second group is the optional extension. The file
    * name looks like: "0_0" or "0_0.gz". There may be a leading prefix (tmp_). Since getTaskId() can
-   * return an integer only - this should match a pure integer as well
+   * return an integer only - this should match a pure integer as well. {1,3} is used to limit
+   * matching for attempts #'s 0-999.
    */
-  private static Pattern fileNameTaskIdRegex = Pattern.compile("^.*?([0-9]+)(_[0-9])?(\\..*)?$");
+  private static Pattern fileNameTaskIdRegex = Pattern.compile("^.*?([0-9]+)(_[0-9]{1,3})?(\\..*)?$");
 
   /**
    * Get the task id from the filename. It is assumed that the filename is derived from the output
